package test;

import java.util.Comparator;

public class PersonSortable {
	private String name;
	private int age;
	public PersonSortable(String name, int age) 
	{
		super();
		this.name = name;
		this.age = age;
	}
	public String toString() 
	{
		return name + "-" + age;
	}
	public String getName()
	{
		return name;
	}
	public int getAge()
	{
		return age;
	}
	Comparator<PersonSortable> NameComparator=(o1,o2)-> o1.getName().compareTo(o2.getName());
	Comparator<PersonSortable> AgeComparator=(o1,o2)-> o1.getAge()-o2.getAge();
}
